import {Entity, PrimaryGeneratedColumn, Column, Timestamp} from 'typeorm'


@Entity({name: 'users'})
export class UserEntity {
    @PrimaryGeneratedColumn({comment: '主键id'})
    id: number;

    @Column({length: 20, comment: '姓名'})
    name: string;

    @Column({comment: '年龄'})
    age: number;

    @Column({comment: '性别'})
    gender: number;

    @Column({comment: '手机号', length: 20})
    phone: string;

    @Column({type: 'timestamp', default: () => 'current_timestamp'})
    createTime: Timestamp;

    @Column({type: 'timestamp', onUpdate: 'current_timestamp', default: () => 'current_timestamp'})
    updateTime: Timestamp;
}